import React from 'react';
import {render} from 'react-dom';
import Button from '@material-ui/core/Button'
import PropTypes from 'prop-types'
import purple from '@material-ui/core/colors/purple'
import red from '@material-ui/core/colors/red'
import MuiThemeProvider from '@material-ui/core/styles/MuiThemeProvider';
import { createMuiTheme } from '@material-ui/core/styles'
const theme = createMuiTheme({
    palette: {
        primary: purple,
        secondary: red,
    },
    typography: {
        useNextVariants: true,
    },
})
class ContainedButton extends React.Component {
    render() {
        return (
            <MuiThemeProvider theme={theme}>
                <Button color={"primary"} variant={"contained"}>按钮</Button>
            </MuiThemeProvider>
        )
    }
}

ContainedButton.propType = {
    text: PropTypes.string,
    disabled: PropTypes.bool,
    disableRipple: PropTypes.bool,
    onClick: PropTypes.func
}
render(<ContainedButton></ContainedButton>, document.querySelector('#root'));